<nz-layout class="app-layout">
  <nz-sider class="menu-sidebar"
            nzCollapsible
            nzWidth="256px"
            nzBreakpoint="md"
            [(nzCollapsed)]="isCollapsed"
            [nzTrigger]="null">
    <div class="sidebar-logo">
      <a href="https://ng.ant.design/" target="_blank">
        <img src="https://ng.ant.design/assets/img/logo.svg" alt="logo">
        <h1>螺丝库存管理器</h1>
      </a>
    </div>
    <ul nz-menu nzTheme="dark" nzMode="inline" [nzInlineCollapsed]="isCollapsed">
      <li nz-submenu nzOpen nzTitle="库存管理" nzIcon="form">
        <ul>
          <li nz-menu-item nzMatchRouter>
            <a routerLink="/screw/transfer">资产转移</a>
          </li>
          <li nz-menu-item nzMatchRouter>
            <a routerLink="/screw/query">资产查询</a>
          </li>
        </ul>
      </li>
    </ul>
  </nz-sider>
  <nz-layout>
    <nz-header>
      <div class="app-header">
        <span class="header-trigger" (click)="isCollapsed = !isCollapsed">
            <i class="trigger"
               nz-icon
               [nzType]="isCollapsed ? 'menu-unfold' : 'menu-fold'"
            ></i>
        </span>
        <div class="server-alive-indicator">
          <div *ngIf="isServerConnected; else serverDisconnected">
            <i nz-icon [nzType]="'check-circle'" nzTheme="twotone" [nzTwotoneColor]="'#52c41a'" class="server-alive-indicator_icon"></i>
            <span class="server-alive-indicator_text">已连接</span>
          </div>
          <ng-template #serverDisconnected>
            <i nz-icon [nzType]="'close-circle'" nzTheme="twotone" [nzTwotoneColor]="'#eb2f96'" class="server-alive-indicator_icon"></i>
            <span class="server-alive-indicator_text">未连接</span>
          </ng-template>
        </div>
      </div>
    </nz-header>
    <nz-content>
      <div class="inner-content">
        <router-outlet></router-outlet>
      </div>
    </nz-content>
  </nz-layout>
</nz-layout>
